package com.neuedu.his.controller;

import com.neuedu.his.po.Constanttype;
import com.neuedu.his.service.ConstanttypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/constanttype")
public class ConstantTypeController {

    @Autowired
    ConstanttypeService service;

    // 添加
    @RequestMapping("/add")
    public Boolean add(@RequestBody Constanttype type){
        return service.save(type);
    }

    // 查询全部
    @RequestMapping("/list")
    public List<Constanttype> list(){
        return service.list();
    }

    // 修改
    @RequestMapping("/update")
    public Boolean update(@RequestBody Constanttype type){
        return service.updateById(type);
    }

    // 删除
    @RequestMapping("/delete")
    public Boolean delete(@RequestBody Constanttype type){
        return service.removeById(type.getId());
    }
}
